package com.xzx.java.kit.basic;

import java.util.Objects;

/**
 * @author xinzhixuan
 * @version V1.0
 * @date 2017/12/13 14:40
 */
public class Student extends Person {
    private float score;

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }

        if (other == null) {
            return false;
        }

        if (getClass() != other.getClass()) {
            return false;
        }

        Student student = (Student) other;
        return score == student.score
                && Objects.equals(name, student.name)
                && age == student.age;
    }

    @Override
    public int hashCode() {
        return Objects.hash(score, name, age);
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
